﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;

namespace LaoLuo.Common.ConsoleTest
{
    class MyClass
    {
        public virtual object Data { get; set; } 
    }

    class MyClass2<T> : MyClass
    {
        public new T Data { get; set; }
    }

    public enum Enum1
    {
        未定义 = 0,
        类型1 = 1,
        类型2 = 2
    }

    public class    Class1
    {
        public Enum1 Enum1 { get; set; }
        public string K1 { get; set; }


        static IEnumerable Get()
        {
            var ret = new List<string>();

            return ret.AsEnumerable();
        } 
    }

    class Program
    {
        private static FontStyle[] _fontStyles = new[]
            {
                FontStyle.Bold,
                FontStyle.Italic,
                FontStyle.Regular
            };
        static Random _random = new Random();
        private static float _imgWidth = 100;

        static void Main(string[] args)
        {
            ICollection<FontStyle> a = new HashSet<FontStyle>(_fontStyles);

           /* foreach (var fontStyle in a)
            {
                Console.WriteLine(fontStyle);
            }*/

            a.Remove(FontStyle.Strikeout);
            a.Add(FontStyle.Regular);

            foreach (var fontStyle in a)
            {
                Console.WriteLine(fontStyle);
            }

            return;

            #region get html

            /*const int pageCount = 1;
            using (var webClient = new WebClient())
            {
                for (int i = 0; i < pageCount; i++)
                {
                    var html = webClient.DownloadString("http://www.topuniversities.com/university-rankings/world-university-rankings/2012?page=" + i);

                    #region solong
                    var stringFilterTemplate = new StringFilterTemplate(@"
<h3 class=""qs-accordion qs-accordion-header university-of-cambridge-united-kingdom2998view-profile""><a href=""#""><a href=""/institution/university-cambridge"">{{name}} <span class=""country"">United Kingdom</span><span class=""rank""><div class=""rankcentre"">#2</div></span>
  <span class=""score"">99.8</span>
  <div class=""score-meter""><img width=""99.8%"" height=""5"" src=""/sites/all/modules/custom/qs_wur/styles/orange.png"" /></div>
  <span class=""stars""><a href=""/qs-stars/view/nojs/95"" rel=""lightmodal[|width:860px;height:520px;text-align:left;]""><img src=""/sites/www.topuniversities.com/modules/custom/qs_stars/images/inline_5.png"" alt=""5 Stars"" title=""5 Stars"" width=""142"" height=""30"" /></a></span>
  <div class=""link-to-profile""><a href=""/institution/university-cambridge"" title=""View Profile"" class=""followlink profilelink"" target=""_blank"">View profile</a></div></a></a></h3>
  <div class=""accordion-content  university-of-cambridge-united-kingdom2998view-profile"">
    <div class=""views-field-container views-row views-row-1"">
      
      <div class=""views-field-field-foundation-year-value"">
        <label class=""views-label-field-foundation-year-value"">
          Founded:
        </label>
        <span class=""field-content""><span class=""date-display-single"">1209</span></span>
      </div>
      
      <div class=""views-field-field-classification-size-value"">
        <label class=""views-label-field-classification-size-value"">
          Size:
        </label>
        <span class=""field-content""><div class=""classfications field_classification_size"" title=""Large ( >=12,000 Students )
          "">L</div></span>
        </div>
        
        <div class=""views-field-field-classification-res-intense-value"">
          <label class=""views-label-field-classification-res-intense-value"">
            Research Intensity:
          </label>
          <span class=""field-content""><div class=""classfications field_classification_res_intense"" title=""Very High (Threshold relative to size and focus)
            "">VH</div></span>
          </div>
          
          <div class=""views-field-field-classification-focus-value"">
            <label class=""views-label-field-classification-focus-value"">
              Focus:
            </label>
            <span class=""field-content""><div class=""classfications field_classification_focus"" title=""Fully Comprehensive (All 5 faculty areas + medical school)
              "">FC</div></span>
            </div>
            
            <div class=""views-field-field-classification-age-value"">
              <label class=""views-label-field-classification-age-value"">
                Age:
              </label>
              <span class=""field-content""><div class=""classfications field_classification_age"" title=""Historic ( >= 100 years )"">5</div></span>
            </div>
            
            <div class=""views-field-field-profile-logo-fid"">
              <span class=""field-content""><a href=""/institution/university-cambridge"" target=""_blank""><img src=""http://www.topuniversities.com/sites/default/files/imagecache/search_result_profile_image/institution/logos/schools_qsnetwork_com-uploads-institution_content-logos-ug-95_large_jpg.jpg"" alt="""" title=""""  class=""imagecache imagecache-search_result_profile_image imagecache-default imagecache-search_result_profile_image_default"" width=""150"" height=""36"" /></a></span>
            </div>
            
            <div class=""views-field-fee-range-info"">
              <span class=""field-content""><table class=""fee-range-table sticky-enabled"">
               <thead><tr><th>Fees Range (USD$)</th><th>Domestic</th><th>International</th> </tr></thead>
               <tbody>
                 <tr class=""odd""><td>Undergraduate</td><td> 14,000 -  16,000</td><td> 22,000 -  24,000</td> </tr>
                 <tr class=""even""><td>Postgraduate</td><td> 4,000 -  6,000</td><td> 24,000 -  26,000</td> </tr>
               </tbody>
             </table></span>
           </div>
           
           <div class=""views-field-nothing"">
            <span class=""field-content""><div class=""indicator-details-container""><p>Score details</p>
              <dl class=""indicator-details"">
                <dt class=""indicator-details first"">Overall</dt><dd class=""first"">99.8 </dd>
                <dt class=""indicator-details beautytips"" title=""Academic Reputation"">AR</dt><dd>100.0</dd>
                <dt class=""indicator-details beautytips"" title=""Employer Reputation"">ER</dt><dd>100.0</dd>
                <dt class=""indicator-details beautytips"" title=""Citations Per Faculty"">CPF</dt><dd>97.0</dd>
                <dt class=""indicator-details beautytips"" title=""Faculty Student"">FS</dt><dd>98.3</dd>
                <dt class=""indicator-details beautytips"" title=""International Faculty"">IF</dt><dd>98.2</dd>
                <dt class=""indicator-details beautytips"" title=""International Students"">IS</dt><dd>96.0</dd>
              </dl>
            </div></span>
          </div>
          
          <div class=""views-field-title-1"">
            <span class=""field-content""><a href=""/institution/university-cambridge"">Visit University of Cambridge's profile</a></span>
          </div>
        </div>
      </div>
");
                    #endregion

                    var resultDictionary = new StringFilter(html, stringFilterTemplate).ResultDictionary;
                    Console.WriteLine(resultDictionary["name"]);
                }
            }*/

            #endregion

            var r = Result.NewPositiveResult("test", "this is done");

            Console.WriteLine(r.ToJavascriptJson());

            Console.WriteLine(r.Data);

            Console.WriteLine(r.ToJson());


            Console.Read();
        }

        static void Write<T>(IEnumerable<T> values)
        {
            foreach (var item in values)
            {
                Console.WriteLine(item);
            }
        }
    }
}
